package com.duoduo.demo.springnoxml.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.duoduo.demo.springnoxml.vo.HelpCategoryVO;
import com.duoduo.demo.springnoxml.vo.HelpKeywordVO;
import com.duoduo.demo.springnoxml.vo.HelpTopicVO;

@Service
public class HelpService {

	@Autowired
	private HelpCategoryService helpCategoryService;
	@Autowired
	private HelpTopicService helpTopicService;
	@Autowired
	private HelpKeywordService helpKeywordService;

	public List<HelpCategoryVO> listAllCategory() {
		return helpCategoryService.listAll();
	}

	public List<HelpCategoryVO> listRootCategory() {
		return listCategoryByParent(0);
	}

	public List<HelpCategoryVO> listCategoryByParent(int parentId) {
		return helpCategoryService.listByParent(parentId);
	}

	public List<HelpTopicVO> listAllTopic() {
		return helpTopicService.listAll();
	}

	public List<HelpTopicVO> listTopicByCategory(int categoryId) {
		return helpTopicService.listByCategory(categoryId);
	}

	public List<HelpTopicVO> listTopicByKeyword(int keywordId) {
		return helpTopicService.listByKeyword(keywordId);
	}

	public List<HelpKeywordVO> listAllKeyword() {
		return helpKeywordService.listAll();
	}

	public List<HelpKeywordVO> listKeywordByTopic(int topicId) {
		return helpKeywordService.listByTopic(topicId);
	}
}
